<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增代理商费率模版')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-agentRateInfo-edit" th:object="${agentRateInfo}">
        <input name="id" th:field="*{id}" type="hidden">
        <input name="isdefault" readonly required class="form-control" th:field="*{isdefault}"  type="hidden">
        <div class="form-group" style="display: none">
            <label class="col-sm-3 control-label is-required">费率模板编号：</label>
            <div class="col-sm-8">
                <input name="arMark" th:field="*{arMark}" id="arMark" required class="form-control" readonly  type="text">
                <i class="fa fa-search" style="margin-top: -22px;margin-right:3px;float:right;"></i>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label  is-required">费率模版：</label>
            <div class="col-sm-8">
                <input name="arName" th:field="*{arName}" required id="arName" class="form-control" onclick="selectMerchantModel()" readonly type="text">
            </div>
        </div>
        <div class="form-group" style="display: none">
            <label class="col-sm-3 control-label is-required">附加费编号：</label>
            <div class="col-sm-8">
                <input id="fjArMark" th:field="*{fjArMark}" name="fjArMark" readonly required class="form-control"  type="text">
                <i class="fa fa-search" style="margin-top: -22px;margin-right:3px;float:right;"></i>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">附加费(元)：</label>
            <div class="col-sm-8">
                <input id="fjArMarkName" th:field="*{fjArMarkName}" name="fjArMarkName"  readonly required onclick="selectMerchantModelFj()" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "agentRateInfo"
    $("#form-agentRateInfo-add").validate({
        focusCleanup: true
    });

    /**
     * 普通费率模版
     */
    function selectMerchantModel(){
        $.modal.open("选择费率模版", prefix + "/selectMerchantModel","800","500");
    }

    /**
     * 附加费率模版
     */
    function selectMerchantModelFj(){
        $.modal.open("选择费率模版", prefix + "/selectMerchantModelFj","800","500");
    }

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-agentRateInfo-edit').serialize());
        }
    }

</script>
</body>
</html>